<?php

namespace app\index\controller;

use think\Exception;
use think\facade\Hook;
use think\container;
use think\Db;
use app\common\model\Message as MessageModel;

class Message
{

    public function index()
    {
        $userId = 1179;
        $mapOr[] = ['user_id', '=', $userId];
        $mapOr[] = ['user_id', '=', 0];
        //$map[] = ['user_id', '=', $userId];

        $map[] = ['delete_time', '=', 0];
        $list = MessageModel::where($map)->where('user_id', ['=', 0], ['=', $userId], 'or')->select();

        return $list;
    }

}
